import numpy as np

def print_curr_map(map):

    print(map)
"""
-1: 
0-N:
"""
def gener_map(N):
    print("generate the map")
    w=0
    h=0
    while w*h < N:
        W_H = input("type the size of map. eg: 5*3\n")
        [w,h]=W_H.split('*')
        w=int(w)
        h=int(h)
    map = np.zeros((h, w))
    for i in range(1,N+1):
        print(i,"th corrdinate")
        get_corr = input()
        corrdinate = get_corr.split(',')
        [x,y] = [int(tmp) for tmp in corrdinate]
        map[x][y]=i
        print_curr_map(map)
    # for i in range(h):
    #     for j in range(w):
    #         if map[i][j]==0:
    #             map[i][j]=-1
    print(map)
    return map

if __name__ == "__main__":
    print("please input the number of dots you want to record. eg:4")
    N = input()
    N = int(N)
    map = gener_map(N)
    f = open('map.txt','w')
    f.write(str(map))